home *** CD-ROM | disk | FTP | other *** search
- Path: howland.reston.ans.net!psinntp!psinntp!psinntp!psinntp!usenet
- From: grantp@usa.pipeline.com(Pete Grant)
- Newsgroups: comp.lang.c++
- Subject: Re: Mixing C, and C++ modules
- Date: 23 Mar 1996 14:21:34 GMT
- Organization: Kalevi, Inc.
- Message-ID: <4j11de$nvg@news1.h1.usa.pipeline.com>
- References: <3153F807.1FBB@access.ch>
- NNTP-Posting-Host: 38.8.60.7
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete Grant)
- X-Newsreader: Pipeline v3.5.0
-
- On Mar 23, 1996 14:09:27 in article <Mixing C, and C++ modules>, 'Jean
- Michel den Hartog <mvslasertechnik@access.ch>' wrote:
-
-
- >Can anyone tell me what I must do to call C functions located in C++
- modules on
- >
- >a project with both C, and C++ modules ??
- >With < extern "C" { } > I can call C code from C++, but not Vice versa...
- >
- Yes, you can. It works both ways. But note that you can't (reasonably)
- call C++ class member functions (nonstatic) from C code. If you declare
- an ordinary c++ function with the extern "C" specification, it is
- callable from C. But note again, that such functions can not be
- overloaded:
-
- #if defined(__cplusplus)
- extern "C" {
- #endif
- int Foo (int i);
- int Foo (double d); // illegal
-
-
- --
- Pete Grant
- Kalevi, Inc.
- Software Engineering & development
-